﻿using System;

using NUnit.Framework;
using Spring.Testing.NUnit;

using VisualAgile.Model;
using VisualAgile.IDAL;

namespace VisualAgile.DAL.Tests
{
    [TestFixture]
    public class FeatureDaoTest : AbstractTransactionalDbProviderSpringContextTests
    {
        protected override string[] ConfigLocations
        {
            get
            {
                return new String[] { "objects.xml" };
            }
        }

        protected IFeatureDao FeatureDao
        {
            get
            {
                return applicationContext.GetObject("FeatureDao") as IFeatureDao;
            }
        }

        [Test]
        public void SaveFeatureTest()
        {
            Feature feature = new Feature();
            
            feature.CreateTime = DateTime.Now;
            feature.Name = "New Feature";
            feature.Target = DateTime.Now.AddDays(27);
            feature.FullSize = true;            

            FeatureDao.Save(feature);
            transactionManager.Commit(transactionStatus);
        }       
    }
}
